/**
 * @description Product 产品信息表
 * @author LI
 */

const seq = require('../sequelize')
const { STRING, INTEGER, DECIMAL } =require('../types')

// Products Product 写入到数据库时为 Products
const Product = seq.define('product', {
  productSn: {
    type: STRING,
    allowNull: false,
    comment: '产品编号'
  },
  productName: {
    type: STRING,
    allowNull: false,
    comment: '产品名称'
  },
  productNumber: {
    type: INTEGER,
    allowNull: false,
    comment: '产品数量'
  },
  productPrice: {
    type: DECIMAL,
    allowNull: false,
    comment: '产品单价'
  },
  productUnit: {
    type: STRING,
    allowNull: false,
    comment: '产品单位'
  },
  goodsPhotoId: {
    type: INTEGER,
    allowNull: false,
    comment: '对应商品图片里面的 id'
  },
  goodsInfoId: {
    type: INTEGER,
    allowNull: false,
    comment: '产品信息对应商品信息里面的 id'
  },
  photoCoordinate: {
    type: STRING,
    allowNull: false,
    comment: '图片锚点的坐标'
  },
  photoDirect: {
    type: STRING,
    allowNull: false,
    comment: '图片锚点图形的说明'
  },
  productLink: {
    type: STRING,
    comment: '产品链接'
  },
  productRemark: {
    type: STRING,
    comment: '产品备注'
  },
  reserve: {
    type: STRING,
    comment: '保留字段'
  }
},
{
  comment: '产品信息表',
})

module.exports = Product
